package com.anhry.app.safety.manage.system.struts.action;

import java.util.Date;
import java.util.List;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.anhry.app.safety.manage.system.bean.TbUser;
import com.anhry.app.safety.manage.system.bean.TbUserDept;
import com.anhry.app.safety.manage.system.bean.TbUserGrade;
import com.anhry.app.safety.manage.system.bean.TbUserRole;
import com.anhry.app.safety.manage.system.bean.TbUserRoleFun;
import com.anhry.app.safety.manage.system.bean.TbUserView;
import com.anhry.app.safety.manage.system.bean.vo.SystemBean;
import com.anhry.app.safety.manage.system.struts.base.SystemBaseAction;
import com.anhry.app.safety.util.Constants;
import com.anhry.app.safety.util.Loggers;
import com.anhry.app.safety.util.Page;
import com.anhry.app.safety.util.PwdDigest;
import com.anhry.app.safety.util.Util;
import com.anhry.app.safety.util.bean.Permission;

/**
 * @date:2012-5-16
 * @remark:用户管理，角色管理
 * @author:dongbin
 */

@Controller
@Scope("prototype")
@SuppressWarnings("unchecked")
public class SystemAction extends SystemBaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private List roleList;
	private String objId;
	private String roleName;
	private String roleRemark;
	private String funIds;
	private TbUserRole role;
	private String funXml;
	private String clock;
	
	private String cGrade;
	private String cUnit;
	private String cDept;
	private String cStreet;
	private String cRole;
	private String cZw;
	private String keyWord;
	private String keyTemp;
	private String search;
	
	private List zwList;
	private List gradeList;
	
	private TbUser user;
	private TbUserView userView;
	private List userList;
	private String userName;//用户登录名称
	private String userRealName;//用户真实姓名
	private String userSex;//性别 0:女1：男
	private String userPwd;//密码
	private String userPhone;//电话（手机）
	private String userEmail;//邮件
	private String userZw;//职务 1：局长 2：副局长 3：处长 4：副处长 5：科长 6：副科长 7：主任 8：副主任 9：科员
	
	private String gradeId;
	private String roleId;
	private String unitId;
	private String deptId;
	private String streetId;
	private String rand;
	private String randErr;
	private String userPwdOld;
	private String userPwdOldErr;
	
	/**
	 * 角色列表
	 * @return
	 */
	
	@Permission(module = "role", permissionVaule = 1)
	public String roleList(){
		int rowCount = 0;
		int num = (this.num != null && !"".equals(this.num ))?Integer.parseInt(this.num ):1;
		int size = (this.size != null && !"".equals(this.size ))?Integer.parseInt(this.size ):10;
		try {
			List objSize = this.systemService.getRoleList(null,0,0);
			if(objSize != null && objSize.size() > 0){
				rowCount = Integer.parseInt(objSize.get(0).toString());
			}
			Page page = new Page(size,num,rowCount);
			this.setPage(page);
			this.setRoleList(this.systemService.getRoleList(null,page.getStartRow(), page.getSize()));
			return "role_list";
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:roleList()异常："+e.getMessage());
		}
		
		return ERROR;
	}
	
	/**
	 * 跳转到角色添加页面
	 * @return
	 */
	@Permission(module = "role", permissionVaule = 0)
	public String roleAdd(){
		return "role_add";
	}
	
	@Permission(module = "role", permissionVaule = 2)
	public String roleUpdate(){
		try {
			if(null!=this.objId && this.objId.length()>0){
				TbUserRole role = (TbUserRole)this.utilService.getObjectById(TbUserRole.class, Long.parseLong(this.objId));
				if(null!=role){
					this.setRole(role);
					List list = this.systemService.getFunListByRole(role);
					String tem = this.systemService.funTreeInit(role,list).asXML();
					tem = tem.replaceAll("\\\"", "\\\\\"");
					tem = tem.replaceAll("\n", "");
					this.setFunXml(tem);
					return "role_update";
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:roleUpdate()异常："+e.getMessage());
		}
		this.setTip("您要修改的数据不存在，请核实后在进行操作！");
		return ERROR;
	}
	@Permission(module = "role", permissionVaule = 3)
	public String roleClock(){
		try {
			if(null!=this.objId && this.objId.length()>0){
				TbUserRole role = (TbUserRole)this.utilService.getObjectById(TbUserRole.class, Long.parseLong(this.objId));
				if(null!=role){
					role.setIsDele(this.clock);
					this.utilService.update(role);
					return this.roleList();
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:roleClock()异常："+e.getMessage());
		}
		this.setTip("您要修改的数据不存在，请核实后在进行操作！");
		return ERROR;
	}
	
	/**
	 * 角色添加
	 * @return
	 */
	public String roleSave(){
		try {
			StringBuilder sbf1 = new StringBuilder();//菜单
			StringBuilder sbf2 = new StringBuilder();//菜单细分项
			if(null!=this.funIds && this.funIds.length()>0){
				String[] funArry = this.funIds.split(",");
				for(String fun : funArry){
					int ind = fun.indexOf("_");
					if(ind>0){
						sbf2.append(fun+",");
					}else{
						sbf1.append(fun+",");
					}
				}
				sbf1.setLength(sbf1.length()-1);
				if(null!=sbf2 && sbf2.length()>0){
					sbf2.setLength(sbf2.length()-1);
				}
			}
			if(null!=this.objId && this.objId.length()>0){
				TbUserRole role = (TbUserRole)this.utilService.getObjectById(TbUserRole.class, Long.parseLong(this.objId));
				if(null!=role){
					role.setRoleName(this.roleName);
					role.setRoleRemark(this.roleRemark);
					this.utilService.update(role);
					this.utilService.deleteBySql("delete tb_user_role_fun t where t.role_id="+role.getId()+"");//将该角色拥有的权限全部删除
					if(null!=sbf1 && sbf1.length()>0){
						String[] arry = sbf1.toString().split(",");
						for(String fun : arry){
							TbUserRoleFun rf = new TbUserRoleFun();
							rf.setFunId(Long.parseLong(fun));
							rf.setIsDele("0");
							rf.setRoleId(role.getId());
							rf.setPermission(1, true);
							this.utilService.save(rf);
							if(null!=sbf2 && sbf2.length()>0){
								String[] arry2 = sbf2.toString().split(",");
								for(String fun2 : arry2){
									if(fun.equals(fun2.substring(0,fun2.indexOf("_")))){
										rf.setPermission(Integer.parseInt(fun2.substring(fun2.indexOf("_")+1,fun2.length())), true);
										this.utilService.update(rf);
									}
								}
							}
						}
					}
					this.setTip("角色修改成功！");
				}
			}else{
				TbUserRole role = new TbUserRole();
				role.setIsDele("0");
				role.setRoleName(this.roleName);
				role.setRoleRemark(this.roleRemark);
				this.utilService.save(role);
				
				if(null!=sbf1 && sbf1.length()>0){
					String[] arry = sbf1.toString().split(",");
					for(String fun : arry){
						TbUserRoleFun rf = new TbUserRoleFun();
						rf.setFunId(Long.parseLong(fun));
						rf.setIsDele("0");
						rf.setRoleId(role.getId());
						rf.setPermission(1, true);
						this.utilService.save(rf);
						if(null!=sbf2 && sbf2.length()>0){
							String[] arry2 = sbf2.toString().split(",");
							for(String fun2 : arry2){
								if(fun.equals(fun2.substring(0,fun2.indexOf("_")))){
									rf.setPermission(Integer.parseInt(fun2.substring(fun2.indexOf("_")+1,fun2.length())), true);
									this.utilService.update(rf);
								}
							}
						}
					}
				}
				this.setTip("角色创建成功！");
			}
			return this.roleList();
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:roleSave()异常："+e.getMessage());
		}
		return ERROR;
	}
	
	/**
	 * 用户列表
	 * @return
	 */
	@Permission(module = "user", permissionVaule = 1)
	public String userList(){
		int rowCount = 0;
		int num = (this.num != null && !"".equals(this.num ))?Integer.parseInt(this.num ):1;
		int size = (this.size != null && !"".equals(this.size ))?Integer.parseInt(this.size ):10;
		try {
			String hql = this.getQuaryHql();
			List objSize = this.systemService.getUserList(hql,0,0);
			if(objSize != null && objSize.size() > 0){
				rowCount = Integer.parseInt(objSize.get(0).toString());
			}
			Page page = new Page(size,num,rowCount);
			this.setPage(page);
			hql += "order by t.gradeId,t.unitId,t.deptId";
			this.setUserList(this.systemService.getUserList(hql,page.getStartRow(), page.getSize()));
			this.setKeyTemp(this.contextPvd.encode(this.keyWord));
			this.setGradeList((List)this.contextPvd.getServletContextAttr(Util.USER_GRADE_LIST));//用户级别
			this.setRoleList(this.systemService.getRoleList("0", 0, -1));//角色列表
			this.setZwList(SystemBean.getZwList());
			return "user_list";
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:userList()异常："+e.getMessage());
		}
		
		return ERROR;
	}
	
	/**
	 * 得到查询hql语句
	 * @return
	 */
	public String getQuaryHql(){
		StringBuilder hql = new StringBuilder(" where 1=1 ");
		String key = "";
		if(null!=this.keyWord && this.keyWord.length()>0){
			if(null!=this.getSearch() && ("1").equals(this.getSearch())){
				key = this.getKeyWord().trim();
			}else{
				key = this.contextPvd.decode(this.getKeyWord());	
			}
			hql.append(" and t.userName like '%"+key+"%'");
		}
		if(null!=this.cGrade && this.cGrade.length()>0){
			hql.append(" and t.gradeId="+this.cGrade);
		}
		if(null!=this.cUnit && this.cUnit.length()>0){
			hql.append(" and t.unitId="+this.cUnit);
		}
		if(null!=this.cDept && this.cDept.length()>0){
			hql.append(" and t.deptId="+this.cDept);
		}
		if(null!=this.cStreet && this.cStreet.length()>0){
			hql.append(" and t.streetId="+this.cStreet);
		}
		if(null!=this.cRole && this.cRole.length()>0){
			hql.append(" and t.roleId="+this.cRole);
		}
		if(null!=this.cZw && this.cZw.length()>0){
			hql.append(" and t.userZw="+this.cZw);
		}
		return hql.toString();
	}
	
	/**
	 * 跳转到用户添加页面
	 * @return
	 */
	public String userAdd(){
		try {
			this.setGradeList((List)this.contextPvd.getServletContextAttr(Util.USER_GRADE_LIST));//用户级别
			this.setRoleList(this.systemService.getRoleList("0", 0, -1));//角色列表
			this.setZwList(SystemBean.getZwList());
			return "user_add";
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:userAdd()异常："+e.getMessage());
		}
		return ERROR;
	}
	
	/**
	 * 跳转到用户修改页面
	 * @return
	 */
	public String userUpdate(){
		try {
			if(null!=this.objId && this.objId.length()>0){
				TbUser user = (TbUser)this.utilService.getObjectById(TbUser.class,Long.parseLong(this.objId));
				if(null!=user){
					this.setUser(user);
					this.setGradeList((List)this.contextPvd.getServletContextAttr(Util.USER_GRADE_LIST));//用户级别
					this.setRoleList(this.systemService.getRoleList("0", 0, -1));//角色列表
					this.setZwList(SystemBean.getZwList());
					return "user_update";
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:userUpdate()异常："+e.getMessage());
		}
		this.setTip("您要修改的数据不存在");
		return ERROR;
	}
	/**
	 * 用户删除
	 * @return
	 */
	public String userDele(){
		try {
			if(null!=this.objId && this.objId.length()>0){
				this.utilService.deleteBySql("update tb_user t set t.is_dele=1 where t.id in("+objId+")");
				this.setTip("删除成功！");
				return this.userList();
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:userDele()异常："+e.getMessage());
		}
		this.setTip("您要删除的数据不存在");
		return ERROR;
	}
	/**
	 * 用户信息查看
	 * @return
	 */
	public String userShow(){
		try {
			if(null!=this.objId && this.objId.length()>0){
				TbUserView user = (TbUserView)this.utilService.getObjectById(TbUserView.class,Long.parseLong(this.objId));
				if(null!=user){
					this.setUserView(user);
					return "user_show";
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:userDele()异常："+e.getMessage());
		}
		this.setTip("您要查看的数据不存在");
		return ERROR;
	}
	
	/*
	 * 密码重置成123456
	 */
	@Permission(module = "user", permissionVaule = 2)
	public void resetPwd(){
		this.contextPvd.getResponse().setHeader("Cache-Control","no-cache");
		try {
			if(null!=this.objId && this.objId.length()>0){
				TbUser user = (TbUser) this.utilService.getObjectById(TbUser.class, Long.parseLong(this.objId));
				if(user != null){
					user.setUserPwd(PwdDigest.passwordDigest(Constants.USER_PASSWORD));
					user.setUserPwd2(Constants.USER_PASSWORD);
					this.utilService.update(user);
					this.contextPvd.getResponse().getWriter().write("1");
				}else{
					this.contextPvd.getResponse().getWriter().write("0");
				}
			}else{
				this.contextPvd.getResponse().getWriter().write("0");
			}
			this.contextPvd.getResponse().getWriter().flush();
			this.contextPvd.getResponse().getWriter().close();
		} catch (Exception e) {
			Loggers.error("manager:SystemAction:resetPwd()出错："+e);
			e.printStackTrace();
		}
	}
	/*
	 * 用户锁定
	 */
	@Permission(module = "user", permissionVaule = 3)
	public void userClock(){
		this.contextPvd.getResponse().setHeader("Cache-Control","no-cache");
		try {
			if(null!=this.objId && this.objId.length()>0){
				TbUser user = (TbUser) this.utilService.getObjectById(TbUser.class, Long.parseLong(this.objId));
				if(user != null){
					user.setIsLock(this.clock);
					this.utilService.update(user);
					this.contextPvd.getResponse().getWriter().write("1");
				}else{
					this.contextPvd.getResponse().getWriter().write("0");
				}
			}else{
				this.contextPvd.getResponse().getWriter().write("0");
			}
			this.contextPvd.getResponse().getWriter().flush();
			this.contextPvd.getResponse().getWriter().close();
		} catch (Exception e) {
			Loggers.error("manager:SystemAction:userClock()出错："+e);
			e.printStackTrace();
		}
	}
	
	/**
	 * 用户保存
	 * @return
	 */
	public String userSave(){
		try {
			TbUserGrade grade = null;
			TbUserRole role = null;
			TbUserDept unit = null;
			TbUserDept dept = null;
			TbUserDept street = null;
			if(null!=this.gradeId && this.gradeId.length()>0){
				grade = (TbUserGrade)this.utilService.getObjectById(TbUserGrade.class, Long.parseLong(this.gradeId));
			}
			if(null!=this.roleId && this.roleId.length()>0){
				role = (TbUserRole)this.utilService.getObjectById(TbUserRole.class, Long.parseLong(this.roleId));
			}
			if(null!=this.unitId && this.unitId.length()>0){
				unit = (TbUserDept)this.utilService.getObjectById(TbUserDept.class, Long.parseLong(this.unitId));
			}
			if(null!=this.deptId && this.deptId.length()>0){
				dept = (TbUserDept)this.utilService.getObjectById(TbUserDept.class, Long.parseLong(this.deptId));
			}
			if(null!=this.streetId && this.streetId.length()>0){
				street = (TbUserDept)this.utilService.getObjectById(TbUserDept.class, Long.parseLong(this.streetId));
			}
			if(null!=this.objId && this.objId.length()>0){
				TbUser obj = (TbUser)this.utilService.getObjectById(TbUser.class, Long.parseLong(this.objId));
				if(null!=obj){
					obj.setTbUserDept(dept);
					obj.setTbUserGrade(grade);
					obj.setTbUserRole(role);
					obj.setTbUserUnit(unit);
					obj.setTbUserStreet(street);
					obj.setUserEmail(this.userEmail);
					obj.setUserPhone(this.userPhone);
					obj.setUserRealName(this.userRealName);
					obj.setUserSex(this.userSex);
					obj.setUserZw(this.userZw);
					obj.setUserName(this.userName);
					this.utilService.update(obj);
					this.setTip("修改成功！");
				}
			}else{
				TbUser obj = new TbUser();
				obj.setIsDele("0");
				obj.setIsLock("0");
				obj.setTbUserDept(dept);
				obj.setTbUserGrade(grade);
				obj.setTbUserRole(role);
				obj.setTbUserStreet(street);
				obj.setTbUserUnit(unit);
				obj.setUserAddTime(new Date());
				obj.setUserEmail(this.userEmail);
				obj.setUserLoginCount(0);
				obj.setUserName(this.userName);
				obj.setUserPhone(this.userPhone);
				obj.setUserRealName(this.userRealName);
				obj.setUserSex(this.userSex);
				obj.setUserZw(this.userZw);
				obj.setUserPwd(PwdDigest.passwordDigest(this.userPwd));
				obj.setUserPwd2(this.userPwd);
				this.utilService.saveOrUpdate(obj);
				this.setTip("添加用户成功！");
			}
			return this.userList();
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.error("SystemAction:userSave()异常："+e.getMessage());
		}
		return ERROR;
	}
	
	/**
	 * 验证用户名是否相同
	 */
	public void userCheck(){
		this.contextPvd.getResponse().setContentType("charset=UTF-8");
		TbUser user = null;
		try {
			if(null!=this.userName && !"".equals(this.userName)){
				user = this.systemService.existsUserName(this.objId,this.contextPvd.decode(this.userName));
				if(null!=user){
					this.contextPvd.getResponse().getWriter().write("1");
				}else{
					this.contextPvd.getResponse().getWriter().write("0");
				}				
			}else{
				this.contextPvd.getResponse().getWriter().write("2");
			}
			this.contextPvd.getResponse().getWriter().flush();
			this.contextPvd.getResponse().getWriter().close();
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.info("SystemAction userCheck()方法："+e);
		}
	}
	
	/**
	 * 加载部门、单位
	 */
	public void loadDept(){
		this.contextPvd.getResponse().setCharacterEncoding("utf-8");
		List<TbUserDept> list = null;
		StringBuffer opts = new StringBuffer();
		try {
			list = this.getDeptList(this.gradeId,this.unitId);
			if(list != null && list.size() > 0){
				opts.append("{");  //保存选项信息
				int counter = 0;                            //计数器
				for(TbUserDept dept:list){
//					如果不是第一项，追加一个“,”用于分隔选项	{'id':'name','id1':'name1'}
	                if (counter > 0) {
	                    opts.append(",");
	                }
	                opts.append("'");
	                opts.append(dept.getId());
	                opts.append("':'");
	                opts.append(dept.getDeptName());
	                opts.append("'");
	                counter++;                      //计数器加1	
				}
				opts.append("}");
			}
			this.contextPvd.getResponse().getWriter().write(opts+"");
			this.contextPvd.getResponse().getWriter().flush();
			this.contextPvd.getResponse().getWriter().close();
		} catch (Exception e) {
			Loggers.error("manager:SystemAction:loadDept()出错："+e);
			e.printStackTrace();
		}
	}
	
	public String userPwd(){
		return "user_pwd";
	}
	
	/*
	 * 密码修改
	 */
	public String userPwdSave(){
		try {
			if(!this.getRand().equals(this.contextPvd.getSessionAttr("rand"))){
				this.setRandErr("验证码错误，请重新输入！");
				return this.userPwd();
			}
			if(this.getUserPwdOld() != null && !"".equals(this.getUserPwdOld())){
				TbUser user = (TbUser)this.contextPvd.getSessionAttr(Util.SESSION_ADMINUSER);
				if(PwdDigest.passwordDigest(this.userPwdOld).equals(user.getUserPwd())){
					user.setUserPwd(PwdDigest.passwordDigest(this.getUserPwd()));//加密密码
					user.setUserPwd2(this.getUserPwd());
					this.utilService.update(user);
					this.setTip("密码修改成功，下次登录时生效!");
					return this.userPwd();
				}else{
					this.setUserPwdOldErr("原密码错误，请重新输入！");
					return this.userPwd();
				}
			}
		} catch (Exception e) {
			Loggers.error("manager:SystemAction:upPwd()出错："+e);
			e.printStackTrace();
		}
		this.setTip("修改密码失败！");
		return this.userPwd();
	}
	
	public List getDeptList(String gradeId,String unitId){
		try {
			TbUserDept sysDept = this.systemService.getDeptByCode(Util.DEPT_CODE);
			StringBuilder hql = new StringBuilder("from TbUserDept t where 1=1 and t.isDele=0");
			if("2".equals(gradeId)){//安办
				if(null!=unitId){
					hql.append(" and t.deptParentId="+unitId);
				}else{
					hql.append(" and t.deptType=0 and t.deptGrade=2 and t.deptClass=1");
				}
			}else if("3".equals(gradeId)){//市级科室
				if(null!=unitId){
					hql.append(" and t.deptParentId="+unitId);
				}else{
					hql.append(" and t.deptType=1 and t.deptGrade=2 and t.deptClass=1");
				}
			}else if("4".equals(gradeId)){//区级科室
				if(null!=unitId){
					hql.append(" and t.deptParentId="+unitId+" and t.deptType=1");
				}else{
					hql.append(" and t.deptType=3 and t.deptParentId="+sysDept.getId());
				}
			}else if("5".equals(gradeId)){//市行业
				if(null!=unitId){
					hql.append(" and t.deptParentId="+unitId);
				}else{
					hql.append(" and t.deptType=2 and t.deptGrade=2");
				}
			}else if("6".equals(gradeId)){//区行业
				if(null!=unitId){
					hql.append(" and t.deptParentId="+unitId+" and t.deptType=2");
				}else{
					hql.append(" and t.deptType=3 and t.deptParentId="+sysDept.getId());
				}
			}else if("7".equals(gradeId)){//镇安监站
				if(null!=unitId){
					hql.append(" and t.deptParentId="+unitId+" and t.deptType=3");
				}else{
					hql.append(" and t.deptType=3 and t.deptParentId="+sysDept.getId());
				}
			}else if("8".equals(gradeId)){//区安委会
				if(null!=unitId){
					hql.append(" and t.deptParentId="+unitId+" and t.deptType=0");
				}else{
					hql.append(" and t.deptType=3 and t.deptParentId="+sysDept.getId());
				}
			} else if("9".equals(gradeId)){//村安监办
				if(null!=unitId){
					hql.append(" and t.deptParentId="+unitId+" and t.deptType=3");
				}else{
					hql.append(" and t.deptType=3 and t.deptParentId="+sysDept.getId());
				}
			} 
			List<TbUserDept> list = (List)this.utilService.getHqlQuery(hql.toString());
			if(null!=list && list.size()>0 && "4".equals(gradeId) && (null==unitId || "".equals(unitId))){
				for(int i=0;i<list.size();i++){
					TbUserDept dept = list.get(i);
					dept.setDeptName(dept.getDeptName()+"安监局");
				}
			}
			if(null!=list && list.size()>0 && "8".equals(gradeId) && (null==unitId || "".equals(unitId))){
				for(int i=0;i<list.size();i++){
					TbUserDept dept = list.get(i);
					dept.setDeptName(dept.getDeptName()+"安委会");
				}
			}
			return list;
		} catch (Exception e) {
			Loggers.error("manager:SystemAction:getDeptList()出错："+e.getMessage());
			e.printStackTrace();
		}
		return null;
	}

	public List getRoleList() {
		return roleList;
	}

	public void setRoleList(List roleList) {
		this.roleList = roleList;
	}

	public String getObjId() {
		return objId;
	}

	public void setObjId(String objId) {
		this.objId = objId;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public String getRoleRemark() {
		return roleRemark;
	}

	public void setRoleRemark(String roleRemark) {
		this.roleRemark = roleRemark;
	}

	public String getFunIds() {
		return funIds;
	}

	public void setFunIds(String funIds) {
		this.funIds = funIds;
	}

	public TbUserRole getRole() {
		return role;
	}

	public void setRole(TbUserRole role) {
		this.role = role;
	}

	public String getFunXml() {
		return funXml;
	}

	public void setFunXml(String funXml) {
		this.funXml = funXml;
	}

	public String getCGrade() {
		return cGrade;
	}

	public void setCGrade(String grade) {
		cGrade = grade;
	}

	public String getCUnit() {
		return cUnit;
	}

	public void setCUnit(String unit) {
		cUnit = unit;
	}

	public String getCDept() {
		return cDept;
	}

	public void setCDept(String dept) {
		cDept = dept;
	}

	public String getCRole() {
		return cRole;
	}

	public void setCRole(String role) {
		cRole = role;
	}

	public String getCZw() {
		return cZw;
	}

	public void setCZw(String zw) {
		cZw = zw;
	}

	public String getKeyWord() {
		return keyWord;
	}

	public void setKeyWord(String keyWord) {
		this.keyWord = keyWord;
	}

	public String getKeyTemp() {
		return keyTemp;
	}

	public void setKeyTemp(String keyTemp) {
		this.keyTemp = keyTemp;
	}

	public String getSearch() {
		return search;
	}

	public void setSearch(String search) {
		this.search = search;
	}

	public List getZwList() {
		return zwList;
	}

	public void setZwList(List zwList) {
		this.zwList = zwList;
	}

	public List getGradeList() {
		return gradeList;
	}

	public void setGradeList(List gradeList) {
		this.gradeList = gradeList;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserRealName() {
		return userRealName;
	}

	public void setUserRealName(String userRealName) {
		this.userRealName = userRealName;
	}

	public String getUserSex() {
		return userSex;
	}

	public void setUserSex(String userSex) {
		this.userSex = userSex;
	}

	public String getUserPwd() {
		return userPwd;
	}

	public void setUserPwd(String userPwd) {
		this.userPwd = userPwd;
	}

	public String getUserPhone() {
		return userPhone;
	}

	public void setUserPhone(String userPhone) {
		this.userPhone = userPhone;
	}

	public String getUserEmail() {
		return userEmail;
	}

	public void setUserEmail(String userEmail) {
		this.userEmail = userEmail;
	}

	public String getUserZw() {
		return userZw;
	}

	public void setUserZw(String userZw) {
		this.userZw = userZw;
	}

	public String getGradeId() {
		return gradeId;
	}

	public void setGradeId(String gradeId) {
		this.gradeId = gradeId;
	}

	public String getRoleId() {
		return roleId;
	}

	public void setRoleId(String roleId) {
		this.roleId = roleId;
	}

	public String getUnitId() {
		return unitId;
	}

	public void setUnitId(String unitId) {
		this.unitId = unitId;
	}

	public String getDeptId() {
		return deptId;
	}

	public void setDeptId(String deptId) {
		this.deptId = deptId;
	}

	public List getUserList() {
		return userList;
	}

	public void setUserList(List userList) {
		this.userList = userList;
	}

	public String getClock() {
		return clock;
	}

	public void setClock(String clock) {
		this.clock = clock;
	}

	public TbUser getUser() {
		return user;
	}

	public void setUser(TbUser user) {
		this.user = user;
	}

	public TbUserView getUserView() {
		return userView;
	}

	public void setUserView(TbUserView userView) {
		this.userView = userView;
	}

	public String getRand() {
		return rand;
	}

	public void setRand(String rand) {
		this.rand = rand;
	}

	public String getRandErr() {
		return randErr;
	}

	public void setRandErr(String randErr) {
		this.randErr = randErr;
	}

	public String getUserPwdOld() {
		return userPwdOld;
	}

	public void setUserPwdOld(String userPwdOld) {
		this.userPwdOld = userPwdOld;
	}

	public String getUserPwdOldErr() {
		return userPwdOldErr;
	}

	public void setUserPwdOldErr(String userPwdOldErr) {
		this.userPwdOldErr = userPwdOldErr;
	}

	public String getCStreet() {
		return cStreet;
	}

	public void setCStreet(String street) {
		cStreet = street;
	}

	public String getStreetId() {
		return streetId;
	}

	public void setStreetId(String streetId) {
		this.streetId = streetId;
	}

}
